#/bin/bash

gamelist=`dirname $0`/gamelist
array=(`awk -F= '/^[a-z]/{print $2}' $gamelist |sort|uniq -c|awk '{if ($1 != 1)print $2}'`)
result=$((${#array[@]}*2))
if [ $result -gt 0 ];then
	echo "$result server instance port contradiction from $gamelist"
	for i in  ${array[@]};do
		grep -P "=$i" $gamelist
	done
fi
exit $result
